package cn.itcast.com.IO.zijieliu.OutPut;

import java.io.*;

public class demo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fileOutputStream2 = null;
        try {
            File file = new File("D:\\代码\\代码\\代码\\cn\\itcast\\com\\Files\\a\\asd.txt");
            fileOutputStream2 = new FileOutputStream(file,true);
            String data1 = "hello world";
            data1.getBytes();
            fileOutputStream2.write(data1.getBytes());
            fileOutputStream2.write('\n');
            fileOutputStream2.write("sad".getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            fileOutputStream2.close();
        }
    }
}
